//
//  GiftCollectionViewCell.m
//  项目A --半糖
//
//  Created by romana on 16/6/2.
//  Copyright © 2016年 romana. All rights reserved.
//

#import "GiftCollectionViewCell.h"


#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height

@implementation GiftCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
        self.backImgView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.backImgView];
        self.backImgView.layer.borderWidth = 1;
        self.backImgView.layer.borderColor = [[UIColor brownColor]CGColor];
        self.backImgView.layer.cornerRadius = 5;
        self.imgView = [[UIImageView alloc] init];
        [self.backImgView addSubview:self.imgView];
        self.nameLable = [[UILabel alloc] init];
        [self.backImgView addSubview:self.nameLable];;
        self.priceLable = [[UILabel alloc] init];
        self.priceLable.textColor = [UIColor redColor];
        [self.backImgView addSubview:self.priceLable];
        self.nameLable.font = [UIFont systemFontOfSize:14];
        self.nameLable.numberOfLines = 2;
        self.imgView.backgroundColor = [UIColor clearColor];
        self.nameLable.backgroundColor = [UIColor clearColor];
        self.priceLable.backgroundColor = [UIColor clearColor];
        
        //        self.likeLable.backgroundColor = [UIColor yellowColor];
        //        self.likeImgView.backgroundColor = [UIColor redColor];
        
    }
    return self;
}

-(void)layoutSubviews{

    [super layoutSubviews];
    self.backImgView.frame = CGRectMake(0, 0, WIDTH, HEIGHT);
    self.imgView.frame = CGRectMake(1, 0, self.contentView.frame.size.width - 2, HEIGHT * 7 / 11);
    self.nameLable.frame = CGRectMake(WIDTH / 12, HEIGHT * 2 / 3 , WIDTH * 10 / 12 + 10, 40);
    self.priceLable.frame = CGRectMake(WIDTH / 12, HEIGHT - HEIGHT / 6 + 5, WIDTH / 3, 25);


}


@end
